package com.xiaoluyy.demo.common.util;

import org.apache.commons.beanutils.Converter;

import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
* 重写enum转换
*
*/
public class EnumConvert implements Converter {

   public Object convert(Class arg0, Object arg1) {
       if (arg1 == null) {
           return null;
       }
       Enum p = (Enum) arg1;
       try {
           return p.ordinal();
       } catch (Exception e) {
               return null;
       }

   }

}
